The present invention relates to a texture mapping apparatus and a texture mapping method for projecting pixel image data in a desired area of a texture plane on figure data in a desired area of a display plane.
There has been an increased demand for design or image effects made by mapping a desired area of figure data previously supplied from an image input device, or figure data drawn by a figure drawing device, onto a surface of a chosen solid figure. To satisfy this demand, texture mapping apparatus have been provided for projecting and displaying a desired two-dimensional (hereinafter referred to as 2D) figure on a desired three-dimensional (hereinafter referred to as 3D) figure.
There is known a texture mapping apparatus in which a 2D texture original figure is divided into line segments in the scan line direction, and the line segments thus obtained are subjected to an inverse perspective transformation for each pixel while the line segments are being scanned on the display plane in the scan line direction. Such texture mapping techniques are discussed in "What is the Texture Mapping (1)", in the Collection of Lectures and Theses [III] by Takeshi 8HIBAMOTO and Makoto KOBAYASHI, Association of Data Processing, Published in Sept. 9, 1985.
In the texture mapping apparatus arranged as abovementioned, it is required to carry out a matrix operation for each pixel; this creates a problem of slow processing speed. In particular, when an animation image, e.g., a video image is sued as a texture original figure, such texture mapping apparatus cannot execute the texture mapping processing in real time after the image is changed. This prevents use of an animation image as a texture original figure.
Further, there are instances where accurate mapping cannot be achieved, depending upon the combination of unit polygons forming a texture original figure with unit polygons forming a figure on the display plane. This results in deterioration of the quality of the figure data displayed on the display plane.
Further, there are instances where polygons constituting a figure on the display plane present a butterfly plane. It is therefore required to judge previously, whether or not three apexes of a polygon exist on the same plane on which another apex exists to thereby identify whether or not the polygon presents a butterfly plane. This not only increases the required processing time, but also reduces the accuracy of texture mapping.
To increase the texture mapping processing speed, as well as to improve the display quality of figure data for which texture mapping processing has been executed, the inventor has proposed a texture mapping apparatus as shown in FIG. 14 and which is disclosed in U.S. patent application Ser. No. 07/100,677, filed Sept. 24, 1987 which has been abandoned in favor of 07/410,017 filed September 1989. With respect to FIG. 14, the latter texture mapping apparatus comprises:
two pairs of side interpolation circuits 111, 112, 113, 114, 115, 116, 121, 122, 123, 124, 125, 126 for linearly interpolating two sides of a polygon on a display plane and two sides of a polygon on a texture plane synchronously;
line segment interpolation circuits 131, 132, 133, 134, 135 for synchronously linearly interpolating the line segments defined by point data obtained by the two pairs of side interpolation circuits 111, 112, 113, 114, 115, 116, 121, 122, 123, 124, 125, 126;
a mapping memory 141 for receiving, as reading addresses, 2D source coordinates data for texture mapping data u, v, supplied from the line segment interpolation circuits 134, 135;
a multiplication circuit 151 for receiving color code data (R, G and B) read from the mapping memory 141, and brightness data I supplied from the line segment interpolation circuit 133 to execute a shading correction operation, etc.;
an I/O interface 161 for fetching drawing command data;
a processor 162 for executing side selection processing and the like; and
a memory 163.
In the texture mapping apparatus having the abovementioned arrangement, two sides of a polygon on a display plane and two sides of a polygon on a texture plane are synchronously linearly interpolated and the line segments thus obtained likewise are linearly interpolated in synchronism. The linear interpolation data for the line segment on the texture plane are supplied to the mapping memory 141. The mapping memory 141 reads out data in which corrections for shading or the like have been made. By projecting these data on the display plane, the texture original figure can be mapped. This mapping is achieved at a speed of about 2,500 polygons/second where one polygon is defined as a regular square of 20 dots (i.e. pixels).times.20 dots whose sides are inclined with respect to the scan line at any arbitrary angle. In the texture mapping apparatus having the above-mentioned arrangement, if even one of the figures on the display plane and on the texture plane undergoes a change, it is required to accordingly carry out linear interpolation, and writing and reading of the liner interpolation data to and from the mapping memory. This not only increases the number of linear interpolation operations, but also the number of data to be written to or read from the mapping memory. This would not achieve texture mapping processing at a speed exceeding 2,500 polygons/second.
Further, it is most unlikely mapping processing of an animation image could be executed in real time at a texture mapping processing speed at 2,500 polygons/second. It is also not possible to deform a 3D figure in which a texture is to be mapped, by rotation, zooming, scaling and the like. Indeed, the use of this texture mapping apparatus is limited to texture mapping processing for a stationary image only.